package com.gyg.controller;

import com.gyg.returns.RespEntity;
import com.gyg.returns.RespTable;
import com.gyg.service.CloudVideoService;
import com.gyg.vo.param.BanParam;
import com.gyg.vo.param.FileParam;
import com.gyg.vo.result.AudioResult;
import com.gyg.vo.result.VideoResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 视频信息表 前端控制器
 * </p>
 *
 * @author gyg
 * @since 2021-04-14
 */
@RestController
@RequestMapping("/cloud-video")
@Api(value = "视频模块", tags = "视频模块")
@Slf4j
public class CloudVideoController {

    @Resource
    private CloudVideoService cloudVideoService;

    @GetMapping("/list")
    @ApiOperation(value = "视频列表")
    public RespTable<List<VideoResult>> videoList(FileParam fileParam) {
        RespTable<List<VideoResult>> respTable = cloudVideoService.videoList(fileParam);
        return respTable;
    }

    @PutMapping("/ban")
    @ApiOperation(value = "封禁视频")
    public RespEntity banVideo(@RequestBody BanParam banParam) {
        RespEntity respEntity = cloudVideoService.banVideo(banParam);
        return respEntity;
    }

    @PutMapping("/unseal")
    @ApiOperation(value = "解封视频")
    public RespEntity unsealVideo(@RequestBody BanParam banParam) {
        RespEntity respEntity = cloudVideoService.unsealVideo(banParam);
        return respEntity;
    }

}
